package com.hmz.backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Message {
    @TableId(type = IdType.AUTO) //声明自增主键
    private int id;
    @TableField(value = "sender_id")
    private int senderId; //发送人的id
    @TableField(value = "receiver_id")
    private int receiverId; //当私聊的时候 为接收人的id 当群聊的时候为聊天室的id
    private String content; //消息的主体内容
    private int type;//消息的类型 0为文字1为图片
    @TableField(value = "create_time")
    private Date createTime; //发送时间
}
